package com.mitake.parse;

import com.mitake.parse.DayK.DayKItem;
import com.mitake.utils.ParseUtil;

public class MitakeDayK {
	
	public static DayK parseDayK(String src){
		DayK dayk =new DayK();
			String [] block03 = src.split(ParseUtil.SPLIT_0x03);
			for(int j=0; j<block03.length; j++){
				String[] block02 = block03[j].split(ParseUtil.SPLIT_0x02);
				DayKItem dayKItem =new DayKItem();
				dayKItem.date = ParseUtil.base93.getDecodeNumber(block02[0]);
				dayKItem.time = ParseUtil.base93.getDecodeNumber(block02[1]);
				dayKItem.firstPrice = ParseUtil.base93.getDecodeNumber(block02[2]);
				dayKItem.highPrice =  ParseUtil.base93.getDecodeNumber(block02[3]);
				dayKItem.lowPrice =   ParseUtil.base93.getDecodeNumber(block02[4]);
				dayKItem.lastPrice =  ParseUtil.base93.getDecodeNumber(block02[5]);
				dayKItem.volume =     ParseUtil.base93.getDecodeNumber(block02[6]);
				dayKItem.reference =  ParseUtil.base93.getDecodeNumber(block02[7]);
				dayk.dayKMap.put(dayKItem.date, dayKItem);
			}
			return dayk;
	}
	
}
